﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Behavioral;
using NUnit.Framework;

namespace Calculator.NUnit
{
    public class ResultShouldEqual : IAssertion<Calculator, int>
    {
        public ResultShouldEqual(int expected)
        {
            this.expected = expected;
        }

        public void Verify(Calculator target, int returnValue)
        {
            Assert.IsNotNull(target);
            Assert.AreEqual(this.expected, returnValue);

            Assert.AreEqual(int.MaxValue, this.GetContext<int>());
            Assert.AreEqual(1, this.GetContext<int>("One"));
            Assert.AreEqual(1, this.Context().One);
            Assert.AreEqual(2, this.GetContext<int>("Two"));
            Assert.AreEqual(2, this.Context().Two);
            Assert.AreEqual(3, this.GetContext<int>("Three"));
            Assert.AreEqual(3, this.Context().Three);
        }

        private int expected;
    }
}
